﻿/********************************************************************************/
// <copyright file="IRepository.cs" company="Asia E-Business Solutions">
//     Copyright © 2012. All right reserved
// </copyright>
//
// <history>
//  <change who="Hieu Nguyen" date="11/12/2012 12:05:56 PM">Created</change>
// <history>
/********************************************************************************/

namespace JLL.China.Infrastructure.RepositoryFramework
{
    using System.Collections.Generic;
    using JLL.China.Infrastructure.DomainBase;
    using JLL.China.Infrastructure.UnitOfWork;

    public interface IRepository<E, T>
        where E : IAggregateRoot<T>
        where T : new()
    {
        void SetUnitOfWork(IUnitOfWork<T> unitOfWork);
        IUnitOfWork<T> UnitOfWork { get; }
        E FindBy(T key);
        IList<E> FindAll();
        void Add(E item);
        E this[T key] { get; set; }
        void Remove(E item);
    }
}
